package com.solairen.myapplication.net

import com.solairen.myapplication.data.ProfileModel
import com.solairen.myapplication.net.BaseRepository

/**
 *
 * @Date 2024/3/5 17:16
 */
object MainRepository : BaseRepository() {
    private val service = HttpClient.instance.getService(ApiService::class.java)

//    suspend fun login(username: String, pwd: String): HttpResult<BaseModel<String>> {
//        val map = mutableMapOf<String, String>().apply {
//            "username" to username
//            "password" to pwd
//        }
//        return safeRequet { service.login(map) }
//    }

    suspend fun register(username: String, pwd: String): HttpResult<BaseModel<String>> {
        val map = mutableMapOf<String, String>().apply {
            "username" to username
            "password" to pwd
        }
        return safeRequest { service.register(map) }
    }

    // 如果需要传递参数在这里定义，类似上面的username和pwd
    suspend fun getData(): HttpResult<BaseModel<String>> {
        val map = mutableMapOf<String, String>().apply {
        }
        return safeRequest { service.getData(map) }
    }
}